/**
 * 
 */
package com.thoughtworks.merchantsguide.common;

import com.thoughtworks.merchantsguide.converter.GalicticToRomanConverter;
import com.thoughtworks.merchantsguide.converter.RomanToArabicConverter;
import com.thoughtworks.merchantsguide.exception.UnsupportedNumberException;

/**
 * Utility class.
 *
 */
public class Utility {

	/**
	 * Utility method to convert GalacticNumber to Arabic number.
	 * 
	 * @param galacticNumbers
	 * @return
	 * @throws UnsupportedNumberException
	 */
	public static long getArabicFromGalacticNumber(String galacticNumbers) throws UnsupportedNumberException {
		// First get the roman equivalent from galactic number.
		String romanEqu = new GalicticToRomanConverter().convert(galacticNumbers);
		// Convert roman number to arabic using romantoarabic converter.
		return new RomanToArabicConverter().convert(romanEqu);
	}
}
